<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::any('admin/login', 'Admin\LoginController@login');
Route::get('admin/code', 'Admin\LoginController@code'); //验证码显示

//中间件
Route::group(['middleware' => 'admin.login','prefix'=>'admin','namespace'=>'Admin'],function(){
    Route::get('index', 'IndexController@index'); //后台首页
    Route::get('info', 'IndexController@info'); //后台详情界面
    Route::get('quit', 'IndexController@quit'); //退出登录
    Route::any('pass', 'IndexController@pass'); //修改密码

    Route::resource('category', 'CategoryController'); //分类资源路由
    Route::post('cate/changeorder', 'CategoryController@changeOrder'); //排序修改

    Route::resource('article', 'ArticleController'); //文章管理
    Route::any('upload', 'CommonController@upload'); //上传文件
});
